#FROM findepi/graalvm:java17-native
FROM registry.cn-shenzhen.aliyuncs.com/private-docker-registry/face-server-devkit

MAINTAINER CPS

ENV SERVER_PORT=8018 LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV MAX_MEM=512
EXPOSE ${SERVER_PORT}

ADD ./target/spring-boot-seetaface6-1.0.0.jar ./app.jar

RUN sh -c 'touch app.jar'
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
ENV JAVA_OPTS="-server -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=256m -Xms64m -Xmx${MAX_MEM}m -Xmn64m -Xss256k -XX:SurvivorRatio=8 -XX:+UseG1GC -XX:MaxGCPauseMillis=50 -XX:SoftRefLRUPolicyMSPerMB=1000 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/heapdump.hprof -Dtask=true"
ENV SPRING_PARAMS="-Dspring.profiles.active=docker"
ENTRYPOINT [ "sh", "-c", "/usr/java/jdk-11.0.1/bin/java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom $SPRING_PARAMS -jar app.jar" ]
